
<?

	$db = mysql_pconnect("localhost", "palhunt", "palhunt");
	if (!$db){
		echo "Error : Could not connect to database. Please try again later.";
		exit;
	}
	mysql_select_db("PalHunt");

	$type = "gender";
	$term = "male";
	$query = "select * from users where ".$type." like '%" .$term."%'";

	echo "<p>query : ".$query . "</p>";

	$result = mysql_query($query);
	$num_results=mysql_num_rows($result);


	echo "<p>number of result: ".$num_results. "</p>";


	for($i=0;$i<$num_results;$i++){
		$row = mysql_fetch_array($result);
		echo "<p><strong>".($i+1).". Account: ";
		echo htmlspecialchars( stripslashes($row["account"]));
//		echo $row["account"];
		echo "</strong><br>Password : ";
		echo htmlspecialchars( stripslashes($row["password"]));
		echo "<br>Name: ";
		echo htmlspecialchars( stripslashes($row["name"]));
		echo "<br>Age: ";
		echo htmlspecialchars( stripslashes($row["age"]));
		echo "<br>Gender: ";
		echo htmlspecialchars( stripslashes($row["gender"]));
		echo "<br>Keywords: ";
		echo htmlspecialchars( stripslashes($row["keyword"]));
		echo "</p> ";
	}


?>
